/**
 */
package usixmlcui.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
import org.eclipse.emf.ecore.util.InternalEList;

import usixmlcui.ConcreteInteractionUnit;
import usixmlcui.ConcreteStyle;
import usixmlcui.Usixml_cuiPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Concrete Style</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link usixmlcui.impl.ConcreteStyleImpl#getConcreteStyles <em>Concrete Styles</em>}</li>
 *   <li>{@link usixmlcui.impl.ConcreteStyleImpl#getConcreteStyle <em>Concrete Style</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ConcreteStyleImpl extends EObjectImpl implements ConcreteStyle {
	/**
	 * The cached value of the '{@link #getConcreteStyles() <em>Concrete Styles</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConcreteStyles()
	 * @generated
	 * @ordered
	 */
	protected EList concreteStyles;

	/**
	 * The cached value of the '{@link #getConcreteStyle() <em>Concrete Style</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getConcreteStyle()
	 * @generated
	 * @ordered
	 */
	protected EList concreteStyle;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ConcreteStyleImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected EClass eStaticClass() {
		return Usixml_cuiPackage.Literals.CONCRETE_STYLE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getConcreteStyles() {
		if (concreteStyles == null) {
			concreteStyles = new EObjectResolvingEList(ConcreteStyle.class, this, Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLES);
		}
		return concreteStyles;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList getConcreteStyle() {
		if (concreteStyle == null) {
			concreteStyle = new EObjectWithInverseResolvingEList.ManyInverse(ConcreteInteractionUnit.class, this, Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE, Usixml_cuiPackage.CONCRETE_INTERACTION_UNIT__INTERACTION_UNIT);
		}
		return concreteStyle;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				return ((InternalEList)getConcreteStyle()).basicAdd(otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				return ((InternalEList)getConcreteStyle()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLES:
				return getConcreteStyles();
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				return getConcreteStyle();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLES:
				getConcreteStyles().clear();
				getConcreteStyles().addAll((Collection)newValue);
				return;
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				getConcreteStyle().clear();
				getConcreteStyle().addAll((Collection)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void eUnset(int featureID) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLES:
				getConcreteStyles().clear();
				return;
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				getConcreteStyle().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLES:
				return concreteStyles != null && !concreteStyles.isEmpty();
			case Usixml_cuiPackage.CONCRETE_STYLE__CONCRETE_STYLE:
				return concreteStyle != null && !concreteStyle.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //ConcreteStyleImpl
